#include <iostream>
using namespace std;

#include "default.h"
#include "interface.h"

int main(int argc, char* argv[])
{
	Interface::head();
	uint32 f_id = 0;

	if ( argc <= 1 )
	{
		f_id = Interface::command( Interface::commands() );
		cout << endl;
	}
	else f_id = Interface::command( argv[1] );

	while ( f_id != Interface::QUIT )
	{
		if ( f_id == Interface::CALC )
		{
			f_id = Interface::calc();
			while( f_id == 0 )
			{
				cout << "To stop write [Quit]." << endl << endl;
				f_id = Interface::calc();
			}
			f_id = 0;
		}

		if ( f_id == Interface::HELP ) Interface::help();
		if ( f_id == Interface::ABOUT ) Interface::about();
		if ( f_id == Interface::QUIT ) break;

		std::cout << endl;
		f_id = Interface::command( Interface::commands() );
		std::cout << endl;
	}

	Interface::quit();
	return 0;
};
